<template>
	<div>
		<ul class="mui-table-view" v-for="item in newList" :link="item.id">
				<li class="mui-table-view-cell mui-media">
					<router-link :to="'/home/newsinfo/'+item.id">
						<img class="mui-media-object mui-pull-left" src="../../images/wei.png">
						<div class="mui-media-body">
							<h3>{{item.title}}</h3>
							<p class='mui-ellipsis'><span>{{item.add_time | dateFormat}}</span><span>点击:{{item.click}}次</span></p>
						</div>
					</router-link>
				</li>
				<!-- <li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="../../images/wei.png">
						<div class="mui-media-body">
							<h3>木屋</h3>
							<p class='mui-ellipsis'><span>发表时间:2019-6-25 23:37</span><span>作者:小爱</span></p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="../../images/wei.png">
						<div class="mui-media-body">
							<h3>爱情</h3>	
							<p class='mui-ellipsis'><span>发表时间:2019-6-25 23:37</span><span>作者:小爱</span></p>
						</div>
					</a>
				</li> -->

			</ul>
	</div>
</template>
<script>
	import { Toast } from 'mint-ui';
	export default{
		data(){
			return{
				newList:[]
			}
		},
		created(){
			this.addList()
		},
		methods:{
			addList(){
				this.$http.get("api/getnewslist").then(result=>{
					if(result.body.status===0) {
						this.newList=result.body.message;
						
					}else{
						Toast('获取数据失败');
					}
				})
			}
		}
	};
</script>
<style lang="less" scoped>
		.mui-table-view{
			h3{
				font-size: 18px;
			}
			p{
				display: flex;
				justify-content: space-between;
			}
		}
</style>
